package data;

import java.util.List;

/**
 * @author wangtong
 * 地图数据结构
 */
public class GrapData {
	public static final int BAR = 1;
	public static final int PATH = 2;
	public static final int G_DIRECT = 10;
	public static final int G_OBLIQUE = 14;
	public static final int H_RADIO = 10;
	
	private int rows;
	private int cols;
	
	private int[][] grap;
	
	private Point start;
	private Point end;
	
	private List<Point> path;

	public GrapData() {
		super();
	}

	public GrapData(int rows, int cols, int[][] grap, Point start, Point end, List<Point> path) {
		super();
		this.rows = rows;
		this.cols = cols;
		this.grap = grap;
		this.start = start;
		this.end = end;
		this.path = path;
	}

	public void updateGrapValue(int x,int y,int value)
	{
		if(y < 0 || y >= rows || x < 0 || x >= cols )
		{
			return;
		}
		
		grap[y][x] = value;
	}

	public void updateGrap(int rows,int cols) {
		this.rows = rows;
		this.cols = cols;
		grap = new int[rows][cols];
	}
	
	public void updateGrap(int[][] matrix) {
		rows = matrix.length;
		cols = matrix[0].length;
		grap = matrix;
	}
	
	public int[][] getGrap() {
		return grap;
	}

	public void setGrap(int[][] grap) {
		this.grap = grap;
	}

	public int getrows() {
		return rows;
	}

	public void setrows(int rows) {
		this.rows = rows;
	}

	public int getcols() {
		return cols;
	}

	public void setcols(int cols) {
		this.cols = cols;
	}

	public List<Point> getPath() {
		return path;
	}

	public void setPath(List<Point> path) {
		this.path = path;
	}

	public Point getStart() {
		return start;
	}

	public void setStart(Point start) {
		this.start = start;
	}

	public Point getEnd() {
		return end;
	}

	public void setEnd(Point end) {
		this.end = end;
	}

}
